<template>
  <div id="app">
    <!-- 登录页 -->
    <div v-if="is_login == 1">
      <router-view></router-view>
    </div>
    <!-- 后台主页 -->
    <div v-if="is_login == 2">
      <web-home></web-home>
    </div>
    <!-- 活动发布 -->
    <div v-if="is_login == 3">
      活动发布
    </div>
  </div>
</template>

<script>
import webHome from './pages/app/home.vue';

export default {
  components:{ webHome },
  data(){
    return {
      is_login : 1
    }
  },
  mounted(){
    this.checkLogin();
  },
  methods: {
    //页面加载判断是否登录
    checkLogin(){
      this.ajaxs('login/checkLogin',{
        success:(res) => {
          if(res.code) {
            this.is_login = 2;
          }else{
            this.is_login = 1;
            setTimeout(()=>{
              this.$router.push({
                path : '/manage/login/index'
              });
            });
          }
        }
      });
    },
    submit() {
      this.$iframe(hellowWord);
    }
  },
  watch:{
  }
};
</script>

<style>
@import url('./assets/css/app.css');
</style>
